//
//  VIPMemberTabCell.m
//  XMDLearn
//
//  Created by macMini on 16/4/15.
//  Copyright © 2016年 hao. All rights reserved.
//

#import "VIPMemberTabCell.h"

@implementation VIPMemberTabCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    
    _isAlpay = YES;
    _isPackYear  = YES;
    
    
    //[_packYearLab.layer setMasksToBounds:YES];//设置按钮的圆角半径不会被遮挡
    
    //[_packYearLab.layer setCornerRadius:10];
    
    [_packYearLab.layer setBorderWidth:2];//设置边界的宽度
    [_alpayLab.layer setBorderWidth:2];
    
    
    
    //设置按钮的边界颜色
    
    float x= 231.0/ 255.0;
    CGColorRef color = CGColorCreate(CGColorSpaceCreateDeviceRGB(), (CGFloat[]){x,x,x,1});
    
    [_alpayLab.layer setBorderColor:color];
    [_packYearLab.layer setBorderColor:color];
    
    //
    
    _openMemberBtn.layer.cornerRadius = 6.0;
    [_openMemberBtn.layer setMasksToBounds:YES];
    
    
    
}


//点击了选择 会员类型 按钮
- (IBAction)Action_chooseMemberTypeYear{

    
    [_packYearsBtn setBackgroundImage:[UIImage imageNamed:@"checkBYES"] forState:normal];
    [_packMounthBtn setBackgroundImage:[UIImage imageNamed:@"checkBNO"] forState:normal];
    _isPackYear = YES;
    
}
- (IBAction)Action_chooseMemberTypeMounth{
    
    [_packYearsBtn setBackgroundImage:[UIImage imageNamed:@"checkBNO"] forState:normal];
    [_packMounthBtn setBackgroundImage:[UIImage imageNamed:@"checkBYES"] forState:normal];
    _isPackYear = NO;
    
}


//点击了会员 支付方式按钮

- (IBAction)Action_chooseAlpay{

    [_alpayBtn setBackgroundImage:[UIImage imageNamed:@"checkBYES"] forState:normal];
    [_wechatpayBtn setBackgroundImage:[UIImage imageNamed:@"checkBNO"] forState:normal];
    _isAlpay = YES;
}
- (IBAction)Action_chooseWechatpay{
    
    [_alpayBtn setBackgroundImage:[UIImage imageNamed:@"checkBNO"] forState:normal];
    [_wechatpayBtn setBackgroundImage:[UIImage imageNamed:@"checkBYES"] forState:normal];
    _isAlpay = NO;
}
//开通会员
- (IBAction)Action_openMember:(id)sender {
    
    [self.delegate GetMemberTime:_isPackYear AndPayType:_isAlpay];

    
}


@end
